<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta charset="utf-8" />
	<title>用户登录</title>
	<meta name="description" content="User login page" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
	<!-- bootstrap & fontawesome -->
	<link rel="stylesheet" href="__PUBLIC__/assets/css/bootstrap.css" />
	<link rel="stylesheet" href="__PUBLIC__/assets/css/font-awesome.css" />
	<!-- 字体 -->
	<link rel="stylesheet" href="__PUBLIC__/assets/css/ace-fonts.css" />
	<!-- ACE样式-->
	<link rel="stylesheet" href="__PUBLIC__/assets/css/ace.css" />
	<!--[if lte IE 9]>
	<link rel="stylesheet" href="__PUBLIC__/assets/css/ace-part2.css" />
	<![endif]-->
	<link rel="stylesheet" href="__PUBLIC__/assets/css/ace-rtl.css" />
	<!--[if lte IE 9]>
	<link rel="stylesheet" href="__PUBLIC__/assets/css/ace-ie.css" />
	<![endif]-->
	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!--[if lt IE 9]>
	<script src="__PUBLIC__/assets/js/html5shiv.js"></script>
	<script src="__PUBLIC__/assets/js/respond.js"></script>
	<![endif]-->
	<style>
		.high{ color:#F00;}
		.loginnone{display:none;}
	</style>
</head>
<body class="login-layout login-layout blur-login">
<div class="main-container">
	<div class="main-content">
		<div class="row">
			<div class="col-sm-10 col-sm-offset-1">
				<div class="login-container">
					<div class="center">
						<h1>
							<i class="ace-icon fa fa-leaf green"></i>
							<span class="red">YFCMF</span>
							<span  class="blue" style="font-family:microsoft yahei" id="id-text2">网站后台管理</span>
						</h1>
					</div>

					<div class="space-6"></div>

					<div class="position-relative">
						<div id="login-box" class="login-box visible widget-box no-border">
							<div class="widget-body">
								<div class="widget-main">
									<h4 class="header blue lighter bigger text-center">
										<i class="ace-icon fa fa-coffee green"></i>
										后台登录
									</h4>

									<div class="space-6"></div>
									<form name="runlogin" id="runlogin" method="post" action="{:U('runlogin')}">
										<fieldset>
											<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" name="admin_username" id="admin_username" placeholder="用户名" />
															<i class="ace-icon fa fa-user"></i>
														</span>
											</label>

											<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control" name="admin_pwd" id="admin_pwd" placeholder="输入密码" />
															<i class="ace-icon fa fa-lock"></i>
														</span>
											</label>
											<label class="block clearfix">
												<span class="block input-icon input-icon-right">
													<input type="text" class="form-control" name="verify" id="verify" placeholder="输入验证码" />
													<i class="ace-icon fa fa-sort-alpha-asc"></i>
												</span>
											</label>
											<label class="block clearfix">
												<span class="block text-center">
													<img class="verify_img" id="verify_img" src="{:U('Login/verify')}" onclick="this.src='{:U('Login/verify')}'" style="cursor: pointer;width:100%;border: 1px solid #d5d5d5;" title="点击获取">
												</span>
											</label>
											<div class="space"></div>
											<div class="space"></div>

											<div class="clearfix">
												<label class="inline">
													<input type="checkbox" class="ace" />
													<span class="lbl"> 记住信息</span>
												</label>

												<button type="submit" class="width-35 pull-right btn btn-sm btn-primary">
													<i class="ace-icon fa fa-key"></i>
													<span class="bigger-110">登录</span>
												</button>
											</div>

											<div class="space-4"></div>
										</fieldset>
									</form>
								</div><!-- /.widget-main -->
							</div><!-- /.widget-body -->
						</div><!-- /.login-box -->
					</div><!-- /.position-relative -->

				</div>
			</div><!-- /.col -->
		</div><!-- /.row -->
	</div><!-- /.main-content -->
</div><!-- /.main-container -->

<script type="text/javascript">
	window.jQuery || document.write("<script src='__PUBLIC__/assets/js/jquery.min.js'>"+"<"+"/script>");
</script>

<script type="text/javascript">
	if('ontouchstart' in document.documentElement) document.write("<script src='__PUBLIC__/assets/js/jquery.mobile.custom.js'>"+"<"+"/script>");
</script>
<script type="text/javascript">
	jQuery(function($) {
		$(document).on('click', '.toolbar a[data-target]', function(e) {
			e.preventDefault();
			var target = $(this).data('target');
			$('.widget-box.visible').removeClass('visible');//hide others
			$(target).addClass('visible');//show target
		});
	});
</script>
<script src="__PUBLIC__/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/assets/js/jquery.form.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script>
	//登入
	$(function(){
		$('#runlogin').ajaxForm({
			beforeSubmit: logcheckForm,
			success: logcomplete,
			dataType: 'json'
		});
		function logcheckForm(){
			if( '' == $.trim($('#admin_username').val())){
				layer.alert('登录用户名不能为空', {icon: 5}, function(index){
					layer.close(index);
					$('#admin_username').focus();
				});
				return false;
			}

			if( '' == $.trim($('#admin_pwd').val())){
				layer.alert('登录密码不能为空', {icon: 5}, function(index){
					layer.close(index);
					$('#admin_pwd').focus();
				});
				return false;
			}

			if( '' == $.trim($('#verify').val())){
				layer.alert('验证码不能为空', {icon: 5}, function(index){
					layer.close(index);
					$('#verify').focus();
				});
				return false;
			}
		}
		function logcomplete(data){
			if(data.status==1){
				window.location.href="{:U('Index/index')}";
			}else{
				$("#verify").val('');
				$("#verify_img").click();
				layer.alert(data.info, {icon: 5});
			}
		}
		return false;
	});
</script>
</body>
</html>
